<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterBillOrderRecordAddTranId extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('mybank_order_record', function (Blueprint $table) {
            $table->string('tranId')->default('')->after('orderId')->comment('交易依据号(唯一防止重复)');

            $table->unique('tranId');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('mybank_order_record', function (Blueprint $table) {
            $table->dropColumn('tranId');
        });
    }
}
